//
// Created by 吴锐 on 2022/2/28.
//

#include "iostream"

using namespace std;

template<class T1, class T2>
class Person;

template<class T1, class T2>
void printPerson2(Person<T1, T2> p) {
    cout << "类外实现的--姓名: " << p.m_Name << " 年龄: " << p.m_Age << endl;
}

template<class T1, class T2>
class Person {
    friend void printPerson(Person<T1, T2> p) {
        cout << "姓名: " << p.m_Name << " 年龄: " << p.m_Age << endl;
    }

    friend void printPerson2<>(Person<T1, T2> p);

private:
    T1 m_Name;
    T2 m_Age;

public:
    Person(T1 name, T2 age) {
        this->m_Name = name;
        this->m_Age = age;
    }
};

void test01() {
    Person<string, int> p("吴锐", 21);
    printPerson(p);
}

void test02() {
    Person<string, int> p("牛马", 21);
    printPerson2(p);
}

int main() {
//    tset01();
    test02();
    return 0;
}